<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorator="admin/layout">
<head>
<title>奖品记录</title>
</head>
<body>
<div layout:fragment="content">
	<div class="row">
			<div class="table-toolbar col-md-12">
				<div class="col-md-15 col-sm-13">
					<form class="form-inline" th:action="@{/admin/product/note/index}" th:object="${noteSearch}"  method="post" id="form_submit">
						<div class="form-group">
							<input type="text" name="name" style="width:80px;" th:field="*{name}" placeholder="奖品名字"  id="keyword" class="form-control" />
						</div> 
						
						<div class="form-group" >
							<div class="col-md-4">
								<input id="noteStartDate" name="noteStartDate" style="width:110px;" th:field="*{noteStartDate}" data-format="yyyy-MM-dd hh:mm:ss" placeholder="开始时间" class="form-control" type="text"></input>
							</div>
						</div>
						<div class="form-group"> 
							<div class="col-md-4">
								<input id="noteEndDate" name="noteEndDate" style="width:110px;" th:field="*{noteEndDate}" data-format="yyyy-MM-dd hh:mm:ss" placeholder="结束时间" class="form-control" type="text"></input>
							</div>
						</div>
						
						<button type="button" id="bt_search" name="bt_search" class="btn green" onclick="checkDate();">
							<i class="fa  fa-search"></i>
						</button>
					</form>
				</div>
			</div>
		</div>
	<div class="row">
		<div class="col-md-12">
			<div id="div_note_table" th:include="/admin/product/note/note_table">
		
			</div>
		</div>
	</div>
</div>	
</body>
</html>
<script th:inline="javascript">
	/*<![CDATA[*/
		  $("#noteStartDate").click(function(){
			WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd ',alwaysUseStartDate:true,readOnly:true});
			}).focus(function () {
            WdatePicker({startDate:'%y-%M-01 ',dateFmt:'yyyy-MM-dd ',alwaysUseStartDate:true,readOnly:true});
        	});
		$("#noteEndDate").click(function(){
			WdatePicker({startDate:'%y-%M-01',dateFmt:'yyyy-MM-dd ',alwaysUseStartDate:true,readOnly:true});
		}).focus(function () {
            WdatePicker({startDate:'%y-%M-01 ',dateFmt:'yyyy-MM-dd ',alwaysUseStartDate:true,readOnly:true});
        });
		  function checkDate(){
			  var startTime=$("#noteStartDate").val();  
			    var start=new Date(startTime.replace("-", "/").replace("-", "/"));  
			    var endTime=$("#noteEndDate").val();  
			    var end=new Date(endTime.replace("-", "/").replace("-", "/"));  
			    if(end<start){  
			        alert("开始时间要小于结束时间"); 
			        return  false;
			    }  
			  $("#form_submit").submit();
		  }
	       
	           
	/*]]>*/
</script>